require('./mongoose')
var mongoose = require('mongoose');
var Schema = mongoose.Schema;

/**
  业务模型
  code: 唯一标识
  name: 名字
  instances: 包含的资源
*/
var businessSchema = Schema({
  code: { type: String, unique: true },
  name: { type: String },
  instances: [{type: Schema.Types.ObjectId, ref: 'Instance'}],
  desc: { type: String },
  icon: { type: String}
})

var Business = mongoose.model('Business', businessSchema);

module.exports = Business
